package situ;

public class Single {
    //饿汉式单例模式
 //   public static Single single=new Single();
    private static Single single;
    private Single(){

    }
    //懒汉试单例模式
    public synchronized static Single getSingle(){
        if(single==null){
            single=new Single();
        }
        return single;
    }
}
